package cn.ulc.store.dao.order;
import cn.ulc.common.constant.enums.AvailableStatus;
import cn.ulc.store.dao.BaseDao;
import cn.ulc.store.entity.order.*;

import org.beetl.sql.core.annotatoin.SqlResource;
import org.beetl.sql.core.engine.PageQuery;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/*
* Order
* gen by Jin mapper 2019-05-29
*/
@SqlResource("order.order")
public interface OrderDao extends BaseDao<Order> {
    PageQuery findListPage(PageQuery pageQuery);

    PageQuery findRiderListPage(PageQuery pageQuery);

    String findMaxOrderNo(String code);
    Order findByOrderNo(String orderNo);
    List<Map<String,Object>> findCountByStatus(Long wxUserId);
    Map<String, Object> findOrderStat(Long companyId, String beginDate, String endDate);
    //会员概述  查看所有会员消费金额  、新会员消费金额、老会员消费金额、总订单数、新会员订单数、老订单数
    Map<String,Object> findMemberStat(Long companyId,String beginDate,String endDate);

    //会员概述  按会员消费金额排名
    List<Map<String,Object>> findMemberRankingStat(Long companyId, AvailableStatus status,String beginDate, String endDate);

    List<BigDecimal> findMemberOrder(Long companyId,String beginDate, String endDate);
    /**
     * 会员消费订单的统计数据
     */
    List<Map<String,Object>> findPeriodMemberStat(Long companyId,String cycle,String beginDate,String endDate);

    List<Order> findOrderList(Long companyId, String beginDate, String endDate);


    List<Order> findByDate(String status,String date);
}
